﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XExcel.Models;

namespace XExcel.Validations
{
    public class ExcelError
    {
        public ExcelError(IXRow row, string colName)
        {
            RowIndex = row.RowIndex;
            ColName = colName;
            ColValue = row.Cells.FirstOrDefault(x => x.ColumnName == colName)?.GetValue<string>();
            ColIndex = row.Sheet.GetColumnIndex(colName);
            SheeetIndex = row.Sheet.SheeetIndex;
            SheeetName = row.Sheet.SheeetName;
        }
        public int RowIndex { get; }
        public int ColIndex { get; }
        public string ColName { get; }
        public string ColValue { get; }
        public int SheeetIndex { get; }
        public string SheeetName { get; }
        public string Message { get; set; }
        public string Name { get; set; }
    }
}
